<?
$element = new element();
$element->find_over($stamdata['id']);
$over = $element->over;
$over_ider = array(); //skal bruges til at tjekke, at eksisterende overbegivenheder ikke er blandt søgeresultaterne.
$over_ider[] = $stamdata['id'];

echo "<p><b class='rubrik'>Eksisterende overbegivenheder:</b></p>";
?><form action="<?php echo base_url();?>core/slet/over/<? echo $stamdata['id']; ?>" method="post"><?
?>
<input type="hidden" name="type" value="begivenhed">
<input type="hidden" name="over" value="<? print_r($over); ?>"><?
foreach($over as $g)
{
	?><p>
	<input type="checkbox" name="over_<? echo $g['over_id']; ?>"> <? echo "<b class='ink'>".$g['navn']."</b>"; ?>
	<?
	$over_ider[] = $g['over_id'];
	$element2 = new element();
	$element2->find_alle_over(array($g['over_id']), FALSE);
	$over_over = $element2->alle_over;
	$antal = count($over_over);
	
	if($antal > 0){
		$count = 1;	
		echo "<br><p style='margin:0px 0px 0px 20px' class='ink'><i>(herigennem medlem af: ";
		foreach($over_over as $h){
			$over_ider[] = $h['id'];
			echo $h['navn'];
			if($count < $antal){ echo ", "; }
			$count = $count +1;
		}
		echo ")</i></p>";
	}
}
?><input style="float:right" type="submit" value="Fjern begivenhed"><?
?></form><?

echo "<br><p><b class='rubrik'>Find nye begivenhedmedlemskaber:</b></p>";

$data['over_ider'] = $over_ider;
$data['type'] = "begivenhed";
$data['omraade'] = "begivenhed";


$this->load->view('soeg/over',$data);

?>
</form>
<?
?>

